<template>
<SdyHeader title="admin" back></SdyHeader>
  <div>
    轮播图管理
    <hr>
    <van-form>
      <van-cell-group inset>
        <van-field
          v-model="adminname"
          name="adminname"
          label="adminname"
          placeholder="adminname"
          :rules="[{ required: true, message: '请填写adminname' }]"
        />
        <van-field
          v-model="password"
          type="password"
          name="密码"
          label="密码"
          placeholder="密码"
          :rules="[{ required: true, message: '请填写密码' }]"
        />
      </van-cell-group>
      <div style="margin: 16px;">
        <van-button
        @click="registerAdmin"
         round block type="primary" native-type="submit">
          登录
        </van-button>
      </div>
    </van-form>
    <hr>
  </div>
</template>

<script setup lang='ts'>
import {ref} from 'vue'
import {registerAdminApi} from '@/api/admin'
//收集注册信息
const adminname = ref<string>('')
const password = ref<string>('')
//登录admin
const registerAdmin = async ()=>{
  const res = await registerAdminApi((adminname as any), (password as any))
  console.log(res)
}



</script>  
<style scoped lang="scss">

</style>